from django.db import models

# Create your models here.

class Script(models.Model):
    """剧本表"""
    #上传时间
    created_time = models.DateTimeField(auto_created=True,verbose_name="上传时间")
    # created_time = models.CharField(max_length=120,verbose_name="上传时间")
    #更新时间
    update_time = models.DateTimeField(auto_now_add=True, verbose_name="更新时间")
    #剧本名字
    name = models.CharField(max_length=50, verbose_name="剧本名字")
    #剧本男性玩家数量
    man_player_num = models.IntegerField(default=1, verbose_name="男性玩家")
    #剧本女性玩家数量
    women_player_num = models.IntegerField(default=1,verbose_name="女性玩家")
    #角色剧本
    role_script = models.CharField(max_length=255, verbose_name="剧本角色")
    #角色文件夹
    role_fiels = models.FileField(verbose_name="上传角色文件", upload_to="up_file", blank=True)
    #剧本封面
    cover = models.CharField(max_length=255, verbose_name="封面照片")
    #剧本线索
    clue = models.CharField(max_length=255, verbose_name="剧本线索")
    #线索文件夹
    clue_fiels = models.FileField(verbose_name="上传上传线索文件", upload_to="up_file", blank=True)
    #剧本分类标签
    label = models.CharField(max_length=255, verbose_name="剧本标签")
    #是否是推荐
    is_recommend = models.BooleanField(default=False, verbose_name="是否是推荐")
    #是否下架
    is_deleted = models.BooleanField(default=False, verbose_name="是否下架")


    #表信息声明
    class Meta:
        db_table = "nxp_script"
        verbose_name = "剧本管理"
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name

    # """轮播广告图模型"""
    # # 模型字段
    # title = models.CharField(max_length=254, verbose_name='广告标题')
    # link = models.CharField(max_length=254, verbose_name="广告链接")
    # # upload_to设置上传文件的报错子目录
    # image_url = models.ImageField(upload_to="banner", max_length=254, null=True, blank=True, verbose_name='广告图片')
    # remark = models.TextField(verbose_name='备注信息')
    # is_show = models.BooleanField(default=False, verbose_name='是否显示')
    # orders = models.IntegerField(default=1, verbose_name='排序')
    # is_deleted = models.BooleanField(default=False, verbose_name='是否删除')
    #
    # # 表信息声明
    # class Meta:
    #     db_table = "ly_banner"
    #     verbose_name = "轮播广告"
    #     verbose_name_plural = verbose_name
    #
    # # 自定义方法
    # def __str__(self):
    #     return self.title


# class Banner(models.Model):
#     """轮播广告图模型"""
#     # 模型字段
#     title = models.CharField(max_length=500, verbose_name="广告标题")
#     link = models.CharField(max_length=500, verbose_name="广告链接")
#     # upload_to 设置上传文件的保存子目录
#     image_url =  models.ImageField(upload_to="banner", null=True, blank=True, max_length=255, verbose_name="广告图片")
#     remark = models.TextField(verbose_name="备注信息")
#     is_show = models.BooleanField(default=False, verbose_name="是否显示")
#     orders = models.IntegerField(default=1, verbose_name="排序")
#     is_deleted = models.BooleanField(default=False, verbose_name="是否删除")
#
#     # 表信息声明
#     class Meta:
#         db_table = "ly_banner"
#         verbose_name = "轮播广告"
#         verbose_name_plural = verbose_name
#
#     # 自定义方法[自定义字段或者自定义工具方法]
#     def __str__(self):
#         return self.title